﻿@using DTcms.Model;
@using DTcms.Common;
@{
   Layout = "~/Areas/admin/Views/Shared/_LayoutEdit.cshtml";
    ViewBag.Title = "系统参数设置";
    sysconfig m = ViewData["model"] as sysconfig;
    if (m == null){
       m = new sysconfig();
    }
    List<SelectListItem> list = new List<SelectListItem>(){
       new SelectListItem(){Text="Arial", Value="Arial"},
       new SelectListItem(){Text="Arial Black", Value="Arial Black"},
       new SelectListItem(){Text="Batang", Value="Batang"},
       new SelectListItem(){Text="BatangChe",Value="BatangChe"},
       new SelectListItem(){Text="Comic Sans MS",Value="Comic Sans MS"},
       new SelectListItem(){Text="Courier New",Value="Courier New"},
       new SelectListItem(){Text="Dotum",Value="Dotum"},
       new SelectListItem(){Text="DotumChe",Value="DotumChe"},
       new SelectListItem(){Text="Estrangelo Edessa",Value="Estrangelo Edessa"},
       new SelectListItem(){Text="Franklin Gothic Medium",Value="Franklin Gothic Medium"},
       new SelectListItem(){Text="Gautami",Value="Gautami"},
       new SelectListItem(){Text="Georgia",Value="Georgia"},
       new SelectListItem(){Text="Gulim",Value="Gulim"},
       new SelectListItem(){Text="GulimChe",Value="GulimChe"},
       new SelectListItem(){Text="Gungsuh",Value="Gungsuh"},
       new SelectListItem(){Text="GungsuhChe",Value="GungsuhChe"},
       new SelectListItem(){Text="Impact",Value="Impact"},
       new SelectListItem(){Text="Latha",Value="Latha"},
       new SelectListItem(){Text="Lucida Console",Value="Lucida Console"},
       new SelectListItem(){Text="Lucida Sans Unicode",Value="Lucida Sans Unicode"},
       new SelectListItem(){Text="Mangal",Value="Mangal"},
       new SelectListItem(){Text="Marlett",Value="Marlett"},
       new SelectListItem(){Text="Microsoft Sans Serif",Value="Microsoft Sans Serif"},
       new SelectListItem(){Text="MingLiU",Value="MingLiU"},
       new SelectListItem(){Text="MS Gothic",Value="MS Gothic"},
       new SelectListItem(){Text="MS Mincho",Value="MS Mincho"},
       new SelectListItem(){Text="MS PGothic",Value="MS PGothic"},
       new SelectListItem(){Text="MS PMincho",Value="MS PMincho"},
       new SelectListItem(){Text="MS UI Gothic",Value="MS UI Gothic"},
       new SelectListItem(){Text="MV Boli",Value="MV Boli"},
       new SelectListItem(){Text="Palatino Linotype",Value="Palatino Linotype"},
       new SelectListItem(){Text="PMingLiU",Value="PMingLiU"},
       new SelectListItem(){Text="Raavi",Value="Raavi"},
       new SelectListItem(){Text="Shruti",Value="Shruti"},
       new SelectListItem(){Text="Sylfaen",Value="Sylfaen"},
       new SelectListItem(){Text="Symbol",Value="Symbol"},
       new SelectListItem(){Text="Tahoma",Value="Tahoma"},
       new SelectListItem(){Text="Times New Roman",Value="Times New Roman"},
       new SelectListItem(){Text="Trebuchet MS",Value="Trebuchet MS"},
       new SelectListItem(){Text="Tunga",Value="Tunga"},
       new SelectListItem(){Text="Verdana",Value="Verdana"},
       new SelectListItem(){Text="Webdings",Value="Webdings"},
       new SelectListItem(){Text="Wingdings",Value="Wingdings"},
       new SelectListItem(){Text="仿宋_GB2312",Value="仿宋_GB2312"},
       new SelectListItem(){Text="宋体",Value="宋体"},
       new SelectListItem(){Text="新宋体",Value="新宋体"},
       new SelectListItem(){Text="楷体_GB2312",Value="楷体_GB2312"},
       new SelectListItem(){Text="黑体",Value="黑体"}
    };
}
@section HeaderContent{
   <script>
      $(function () {
         $("#form1").initValidform();
      });
   </script>
}

@section Scripts{
<script src="~/Scripts/jquery/jquery.nicescroll.js"></script>
}

@using (Html.BeginForm("SubmitSave", "Sys_Config", FormMethod.Post, new { id = "form1" })) {
   <!--导航栏-->
   <div class="location">
      <a href="javascript:hitory.back(-1);" class="back"><i class="iconfont icon-up"></i><span>返回上一页</span></a>
      <a href="../../Center/Index"><i class="iconfont icon-home"></i><span>首页</span></a>
      <i class="arrow iconfont icon-arrow-right"></i>
      <span>系统参数配置</span>
   </div>
   <div class="line10"></div>
   <!--/导航栏-->
   
   <!--内容-->
   <div id="floatHead" class="content-tab-wrap">
      <div class="content-tab">
         <div class="content-tab-ul-wrap">
            <ul>
               <li><a class="selected" href="javascript:;">系统基本信息</a></li>
               <li><a href="javascript:;">功能权限设置</a></li>
               <li><a href="javascript:;">短信平台设置</a></li>
               <li><a href="javascript:;">邮件发送设置</a></li>
               <li><a href="javascript:;">文件服务器</a></li>
               <li><a href="javascript:;">文件上传设置</a></li>
            </ul>
         </div>
      </div>
   </div>
   
   <!--主站基本信息-->
   <div class="tab-content">
     <dl>
       <dt>主站名称</dt>
       <dd>
         @Html.TextBox("webname", m.webname, new{@class="input normal", datatype="*2-255", sucmsg=" "})
         <span class="Validform_checktip">*任意字符，控制在255个字符内</span>
       </dd>
     </dl>
     <dl>
       <dt>主站域名</dt>
       <dd>
          @Html.TextBox("weburl", m.weburl, new{@class="input normal", datatype="url", sucmsg=" "})
         <span class="Validform_checktip">*以“http://”开头，不能绑定到频道分类</span>
       </dd>
     </dl>
     <dl>
       <dt>公司名称</dt>
       <dd>
          @Html.TextBox("webcompany", m.webcompany, new{@class="input normal"})
       </dd>
     </dl>
     <dl>
       <dt>通讯地址</dt>
       <dd>
          @Html.TextBox("webaddress", m.webaddress, new{@class="input normal"})
       </dd>
     </dl>
     <dl>
       <dt>客服电话</dt>
       <dd>
          @Html.TextBox("webtel", m.webtel, new{@class="input normal"})
         <span class="Validform_checktip">*非必填，区号+电话号码</span>
       </dd>
     </dl>
     <dl>
       <dt>传真号码</dt>
       <dd>
          @Html.TextBox("webfax", m.webfax, new{@class="input normal"})
         <span class="Validform_checktip">*非必填，区号+传真号码</span>
       </dd>
     </dl>
     <dl>
       <dt>管理员邮箱</dt>
       <dd>
          @Html.TextBox("webmail", m.webmail, new{@class="input normal"})
       </dd>
     </dl>
     <dl>
       <dt>主站备案号</dt>
       <dd>
          @Html.TextBox("webcrod", m.webcrod, new{@class="input normal"})
       </dd>
     </dl>
   </div>   
   <!--/主站基本信息-->
   
   <!--功能权限设置-->
   <div class="tab-content" style="display:none">
     <dl>
       <dt>网站安装目录</dt>
       <dd>
         @Html.TextBox("webpath", m.webpath, new { @class = "input txt", datatype = "*1-100", sucmsg = " " })
         <span class="Validform_checktip">*根目录输入“/”，其它输入“/目录名/”</span>
       </dd>
     </dl>
     <dl>
       <dt>后台管理目录</dt>
       <dd>
         @Html.TextBox("webmanagepath", m.webmanagepath, new{@class="input txt", datatype="*1-100", sucmsg=" "})
         <span class="Validform_checktip">*默认admin，其它请输入目录名，否则无法进入后台</span>
       </dd>
     </dl>
     <dl>
       <dt>URL重写开关</dt>
       <dd>
         <div class="rule-multi-radio">
           <span id="staticstatus">
              @Html.RadioButton("staticstatus", "0", m.staticstatus == 0, new { id = "staticstatus_0" })<label for="staticstatus_0">关闭</label>
              @Html.RadioButton("staticstatus", "1", m.staticstatus == 1, new { id = "staticstatus_1" })<label for="staticstatus_1">伪URL重写</label>
              @Html.RadioButton("staticstatus", "2", m.staticstatus == 2, new { id = "staticstatus_2" })<label for="staticstatus_2">生成静态</label>
           </span>
         </div>
         <span class="Validform_checktip">*URL配置规则，点击这里查看说明</span>
       </dd>
     </dl>
     <dl>
       <dt>静态URL后缀</dt>
       <dd>
         @Html.TextBox("staticextension", m.staticextension, new{ @class="input small", datatype="*1-100", sucmsg=" "})
         <span class="Validform_checktip">*扩展名，不包括“.”，访问或生成时将会替换此值，如：aspx、html、cshtml</span>
       </dd>
     </dl>
     <dl>
       <dt>开启会员功能</dt>
       <dd>
         <div class="rule-single-checkbox">
            @Html.CheckBox("memberstatus", m.memberstatus == 1)
         </div>
         <span class="Validform_checktip">*关闭后关联会员的内容将失效</span>
       </dd>
     </dl>
     <dl>
       <dt>开启评论审核</dt>
       <dd>
         <div class="rule-single-checkbox">
            @Html.CheckBox("commentstatus", m.commentstatus == 1)
         </div>
         <span class="Validform_checktip">*开启后评论将会审核才显示</span>
       </dd>
     </dl>
     <dl>
       <dt>开启管理日志</dt>
       <dd>
         <div class="rule-single-checkbox">
            @Html.CheckBox("logstatus", m.logstatus == 1)
         </div>
         <span class="Validform_checktip">*开启后将会记录管理员在后台的操作日志</span>
       </dd>
     </dl>
     <dl>
       <dt>是否开启网站</dt>
       <dd>
         <div class="rule-single-checkbox">
            @Html.CheckBox("webstatus", m.webstatus == 1)
         </div>
         <span class="Validform_checktip">*关闭后网站前台将不能访问</span>
       </dd>
     </dl>
     <dl>
       <dt>网站关闭原因</dt>
       <dd>
          @Html.TextArea("webclosereason", m.webclosereason, new{@class="input"})
         <span class="Validform_checktip">支持HTML</span>
       </dd>
     </dl>
     <dl>
       <dt>网站统计代码</dt>
       <dd>
          @Html.TextArea("webcountcode", m.webcountcode, new{@class="input"})
         <span class="Validform_checktip">支持HTML</span>
       </dd>
     </dl>
   </div>   
   <!--/功能权限设置-->
   
<!--手机短信设置-->
<div class="tab-content" style="display:none">
  <dl>
    <dt>短信剩余数量</dt>
    <dd>
      <label>@ViewBag.labSmsCount</label>
      <span class="Validform_checktip">尚未申请？<a href="http://sms.dtcms.net" target="_blank">请点击这里注册</a></span>
    </dd>
  </dl>
  <dl>
    <dt>短信API地址</dt>
    <dd>
      @Html.TextBox("smsapiurl", m.smsapiurl, new{@class="input normal"})
      <span class="Validform_checktip">*以“http://”开头</span>
    </dd>
  </dl>
  <dl>
    <dt>平台登录账户</dt>
    <dd>
      @Html.TextBox("smsusername", m.smsusername, new{@class="input txt"})
      <span class="Validform_checktip">*短信平台注册的用户名</span>
    </dd>
  </dl>
  <dl>
    <dt>平台登录密码</dt>
    <dd>
      @Html.Password("smspassword", m.smspassword, new{@class="input txt"})
      <span class="Validform_checktip">*短信平台注册的密码</span>
    </dd>
  </dl>
  <dl>
    <dt>短信平台说明</dt>
    <dd>
      请不要使用系统默认账户test，因为它是公用的测试账号；<br />
      请在短信平台修改账户资料中绑定签名方可使用短信功能；<br />
      如果您尚未申请开通，<a href="http://www.dtcms.net" target="_blank">请点击这里注册</a>成功后填写您的用户名和密码均可正常使用。
    </dd>
  </dl>
</div>
<!--/手机短信设置-->

<!--邮件发送设置-->
<div class="tab-content" style="display:none">
  <dl>
    <dt>SMTP服务器</dt>
    <dd>
      @Html.TextBox("emailsmtp", m.emailsmtp, new{@class="input normal", datatype="*0-100", sucmsg=" "})
      <span class="Validform_checktip">*发送邮件的SMTP服务器地址</span>
    </dd>
  </dl>
  <dl>
    <dt>SSL加密连接</dt>
    <dd>
      <div class="rule-single-checkbox">
         @Html.CheckBox("emailssl", m.emailssl == 1)
      </div>
      <span class="Validform_checktip">*是否启用SSL加密连接</span>
    </dd>
  </dl>
  <dl>
    <dt>SMTP端口</dt>
    <dd>
      @Html.TextBox("emailport", m.emailssl, new{@class="input small", datatype="n", sucmsg=" "})
      <span class="Validform_checktip">*SMTP服务器的端口，大部分服务商都支持25端口</span>
    </dd>
  </dl>
  <dl>
    <dt>发件人地址</dt>
    <dd>
      @Html.TextBox("emailfrom", m.emailfrom, new{@class="input normal", datatype="e", sucmsg=" "})
      <span class="Validform_checktip">*发件人的邮箱地址</span>
    </dd>
  </dl>
  <dl>
    <dt>邮箱账号</dt>
    <dd>
      @Html.TextBox("emailusername", m.emailusername, new{@class="input normal", datatype="*0-100", sucmsg=" "})
      <span class="Validform_checktip">*</span>
    </dd>
  </dl>
  <dl>
    <dt>邮箱密码</dt>
    <dd>
      @Html.Password("emailpassword", m.emailpassword, new{@class="input normal", datatype="*0-100", sucmsg=" "})
      <span class="Validform_checktip">*</span>
    </dd>
  </dl>
  <dl>
    <dt>发件人昵称</dt>
    <dd>
      @Html.TextBox("emailnicename", m.emailnickname, new{@class="input normal", datatype="*0-50", sucmsg=" "})
      <span class="Validform_checktip">*对方收到邮件时显示的昵称</span>
    </dd>
  </dl>
</div>
<!--/邮件发送设置-->

<!--文件服务器-->
<div class="tab-content" style="display:none">
  <dl>
    <dt>文件服务器</dt>
    <dd>
      <div class="rule-multi-radio">
         @Html.RadioButton("fileserver", "localhost", m.fileserver=="localhost", new { id="fileserver_1" })<label for="fileserver_1">本地存储</label>
         @Html.RadioButton("fileserver", "localhost", m.fileserver=="aliyun", new { id="fileserver_2" })<label for="fileserver_2">阿里云OSS</label>
      </div>
      <span class="Validform_checktip">*非本地存储请申请开通云存储完善设置</span>
    </dd>
  </dl>
  <dl>
    <dt>阿里云KeyId</dt>
    <dd>
      @Html.TextBox("osssecretid", m.osssecretid, new { @class="input normal", datatype="*0-255", sucmsg=" "})
      <span class="Validform_checktip">*阿里云OSS对象存储的Access KeyId</span>
    </dd>
  </dl>
  <dl>
    <dt>阿里云SecretKey</dt>
    <dd>
      @Html.TextBox("osssecretkey", m.osssecretkey, new { @class="input normal", datatype="*0-255", sucmsg=" "})
      <span class="Validform_checktip">*阿里云OSS对象存储的Access KeySecret</span>
    </dd>
  </dl>
  <dl>
    <dt>阿里云Bucket</dt>
    <dd>
      @Html.TextBox("ossbucket", m.ossbucket, new { @class="input normal", datatype="*0-255", sucmsg=" "})
      <span class="Validform_checktip">*阿里云OSS对象存储的存储空间名称</span>
    </dd>
  </dl>
  <dl>
    <dt>阿里云EndPoint</dt>
    <dd>
      @Html.TextBox("ossendpoint", m.ossendpoint, new { @class="input normal", datatype="*0-255", sucmsg=" "})
      <span class="Validform_checktip">*阿里云OSS对象存储的区域外网(不含http://)</span>
    </dd>
  </dl>
  <dl>
    <dt>阿里云绑定域名</dt>
    <dd>
      @Html.TextBox("ossdomain", m.ossdomain, new { @class="input normal", datatype="*0-255", sucmsg=" "})
      <span class="Validform_checktip">*阿里云OSS对象存储的自定义访问域名(不含http://)</span>
    </dd>
  </dl>
</div>
<!--/文件服务器-->   
      
<!--上传配置-->
<div class="tab-content" style="display:none">
  <dl>
    <dt>文件上传目录</dt>
    <dd>
      @Html.TextBox("filepath", m.filepath, new{@class="input txt", datatype="*2-100", sucmsg=" "})
      <span class="Validform_checktip">*文件保存的目录名，自动创建根目录下</span>
    </dd>
  </dl>
  <dl>
    <dt>文件保存方式</dt>
    <dd>
      <div class="rule-single-select">
      @Html.DropDownList("filesave", new List<SelectListItem>{
            new SelectListItem(){ Text = "按年月日每天一个目录", Value = "0", Selected = (m.filesave == 0)},
            new SelectListItem(){ Text = "按年月/日/存入不同目录", Value = "1", Selected = (m.filesave == 1)}
         })
      </div>
    </dd>
  </dl>
  <dl>
    <dt>编辑器图片</dt>
    <dd>
      <div class="rule-multi-radio">
        @Html.RadioButton("fileremote", "0", m.fileremote == 0, new { id="fileremote_0" })<label for="fileremote_0">关闭下载</label>
        @Html.RadioButton("fileremote", "1", m.fileremote == 0, new { id="fileremote_1" })<label for="fileremote_1">自动下载</label>
      </div>
    </dd>
  </dl>
  <dl>
    <dt>文件上传类型</dt>
    <dd>
      @Html.TextBox("fileextension", m.fileextension, new{@class="input normal", datatype="*1-500", sucmsg=" "})
      <span class="Validform_checktip">*以英文的逗号分隔开，如：“zip,rar”</span>
    </dd>
  </dl>
  <dl>
    <dt>视频上传类型</dt>
    <dd>
      @Html.TextBox("videoextension", m.videoextension, new{@class="input normal", datatype="*1-500", sucmsg=" "})
      <span class="Validform_checktip">*以英文的逗号分隔开，如：“mp4,flv”</span>
    </dd>
  </dl>
  <dl>
    <dt>附件上传大小</dt>
    <dd>
      @Html.TextBox("attachsize", m.attachsize, new{@class="input small", datatype="n", sucmsg=" "}) KB
      <span class="Validform_checktip">*超过设定的文件大小不予上传，0不限制</span>
    </dd>
  </dl>
  <dl>
    <dt>视频上传大小</dt>
    <dd>
      @Html.TextBox("videosize", m.videosize, new{@class="input normal", datatype="n", sucmsg=" "}) KB
      <span class="Validform_checktip">*超过设定的文件大小不予上传，0不限制</span>
    </dd>
  </dl>
  <dl>
    <dt>图片上传大小</dt>
    <dd>
      @Html.TextBox("imgsize", m.imgsize, new{@class="input small", datatype="n", sucmsg=" "}) KB
      <span class="Validform_checktip">*超过设定的图片大小不予上传，0不限制</span>
    </dd>
  </dl>
  <dl>
    <dt>图片最大尺寸</dt>
    <dd>
      @Html.TextBox("imgmaxheight", m.imgmaxheight, new{@class="input small", datatype="n", sucmsg=" "}) x
      @Html.TextBox("imgmaxwidth", m.imgmaxwidth, new{@class="input small", datatype="n", sucmsg=" "}) px
      <span class="Validform_checktip">*左边高度，右边宽度，超出自动裁剪，0为不受限制</span>
    </dd>
  </dl>
  <dl>
    <dt>缩略图生成尺寸</dt>
    <dd>
      @Html.TextBox("thumbnailheight", m.thumbnailheight, new{@class="input small", datatype="n", sucmsg=" "}) x
      @Html.TextBox("thumbnailwidth", m.thumbnailwidth, new{@class="input small", datatype="n", sucmsg=" "}) px 
      <span class="Validform_checktip">*左边高度，右边宽度，0为不生成缩略图</span>
    </dd>
  </dl>
  <dl>
    <dt>图片水印类型</dt>
    <dd>
      <div class="rule-multi-radio">
        @Html.RadioButton("watermarktype", "0", m.watermarktype == 0, new{ id= "watermarktype_0" })<label for="watermarktype_0">关闭水印</label>
        @Html.RadioButton("watermarktype", "1", m.watermarktype == 1, new{ id= "watermarktype_1" })<label for="watermarktype_1">文字水印</label>
        @Html.RadioButton("watermarktype", "2", m.watermarktype == 2, new{ id= "watermarktype_2" })<label for="watermarktype_2">图片水印</label>
      </div>
    </dd>
  </dl>
  <dl>
    <dt>图片水印位置</dt>
    <dd>
      <div class="rule-multi-radio">
        @Html.RadioButton("watermarkposition", "1", m.watermarkposition == 1, new{ id= "watermarkpositione_1" })<label for="watermarkpositione_1">中上</label>
        @Html.RadioButton("watermarkposition", "2", m.watermarkposition == 2, new{ id= "watermarkpositione_2" })<label for="watermarkpositione_2">中上</label>
        @Html.RadioButton("watermarkposition", "3", m.watermarkposition == 3, new{ id= "watermarkpositione_3" })<label for="watermarkpositione_3">右上</label>
        @Html.RadioButton("watermarkposition", "4", m.watermarkposition == 4, new{ id= "watermarkpositione_4" })<label for="watermarkpositione_4">左中</label>
        @Html.RadioButton("watermarkposition", "5", m.watermarkposition == 5, new{ id= "watermarkpositione_5" })<label for="watermarkpositione_5">居中</label>
        @Html.RadioButton("watermarkposition", "6", m.watermarkposition == 6, new{ id= "watermarkpositione_6" })<label for="watermarkpositione_6">右中</label>
        @Html.RadioButton("watermarkposition", "7", m.watermarkposition == 7, new{ id= "watermarkpositione_7" })<label for="watermarkpositione_7">左下</label>
        @Html.RadioButton("watermarkposition", "8", m.watermarkposition == 8, new{ id= "watermarkpositione_8" })<label for="watermarkpositione_8">中下</label>
        @Html.RadioButton("watermarkposition", "9", m.watermarkposition == 9, new{ id= "watermarkpositione_9" })<label for="watermarkpositione_9">右下</label>
      </div>
    </dd>
  </dl>
  <dl>
    <dt>图片生成质量</dt>
    <dd>
      @Html.TextBox("watermarkimgquality", m.watermarkimgquality, new{@class="input small", datatype="n", sucmsg=" "})
      <span class="Validform_checktip">*只适用于加水印的jpeg格式图片.取值范围 0-100, 0质量最低, 100质量最高, 默认80</span>
    </dd>
  </dl>
  <dl>
    <dt>图片水印文件</dt>
    <dd>
      @Html.TextBox("watermarkpic", m.watermarkpic, new{@class="input txt", datatype="s2-100", sucmsg=" "})
      <span class="Validform_checktip">*需存放在站点目录下，如图片不存在将使用文字水印</span>
    </dd>
  </dl>
  <dl>
    <dt>水印透明度</dt>
    <dd>
      @Html.TextBox("watermarktransparency", m.watermarktransparency, new{@class="input small", datatype="n", sucmsg=" "})
      <span class="Validform_checktip">*取值范围1--10 (10为不透明)</span>
    </dd>
  </dl>
  <dl>
    <dt>水印文字</dt>
    <dd>
      @Html.TextBox("watermarktext", m.watermarktext, new{@class="input txt", datatype="s2-100", sucmsg=" "})
      <span class="Validform_checktip">*文字水印的内容</span>
    </dd>
  </dl>
  <dl>
    <dt>文字字体</dt>
    <dd>
      <div class="rule-single-select up">
         @Html.DropDownList("watermarkfont", new SelectList(list, "Value", "Text", m.watermarkfont))
      </div>
      @Html.TextBox("watermarkfontsize", m.watermarkfontsize, new{@class="input small", datatype="n", sucmsg=" "}) px
      <span class="Validform_checktip">*文字水印的字体和大小 </span>
    </dd>
  </dl>
</div>
<!--/上传配置-->
<!--/内容-->
<!--工具栏-->
<div class="page-footer">
  <div class="btn-wrap">
    <input type="submit" id="btnSubmit" class="btn" value="提交保存" />
    <input name="btnReturn" type="button" value="返回上一页" class="btn yellow" onclick="javascript: history.back(-1);" />
  </div>
</div>
<!--/工具栏-->
}